package com.gexiaobao.pigeon.ui.adapter

import androidx.appcompat.widget.AppCompatImageView
import androidx.appcompat.widget.AppCompatTextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.gexiaobao.pigeon.R
import com.gexiaobao.pigeon.app.base.DataBindBaseViewHolder
import com.gexiaobao.pigeon.app.model.bean.EvaluateListResponse
import com.gexiaobao.pigeon.app.util.ImageLoaderManager
import com.gexiaobao.pigeon.app.util.SettingUtil
import com.gexiaobao.pigeon.databinding.ItemEvaluateListBinding

/**
 * @Author      : hxw
 * @Date        : 2023/7/7 15:50
 * @Describe    :
 */
class EvaluateListAdapter(data: ArrayList<EvaluateListResponse.ListBean>) :
    BaseQuickAdapter<EvaluateListResponse.ListBean, DataBindBaseViewHolder>(R.layout.item_evaluate_list, data) {

    override fun convert(holder: DataBindBaseViewHolder, item: EvaluateListResponse.ListBean) {
        val binding = DataBindBaseViewHolder.getBinding(holder) as ItemEvaluateListBinding
        binding.data = item
        binding.executePendingBindings()//防止列表抖动

        val ivGoodImage = holder.getView<AppCompatImageView>(R.id.ivGoodImage)
        ImageLoaderManager.loadRoundImage(context, item.specImg, ivGoodImage, 8)
    }

}